package service;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import entity.Answer;
import entity.Choose;
import entity.Question;
import entity.Survey;
import entity.User;
import mapper.UserMapper;

@Service
public class UserService {
	@Resource
	private UserMapper userMapper;
	// private static List<user> users;

	public UserMapper getUserMapper() {
		return userMapper;
	}

	public void setUserMapper(UserMapper userMapper) {
		this.userMapper = userMapper;
	}

	public User Login(User user) {
//		User user = new User();
//		user.setUserId(userId);
//		user.setPassWord(passWord);
		return userMapper.Login(user);
	}
	public int Register(User user){
		return userMapper.Register(user);
	}
	
	public Survey querySurvey(Integer queryId){
		return userMapper.querySurvey(queryId);
	}
	
	public Choose[] queryChoose(Integer queryChId){
		return userMapper.queryChoose(queryChId);
	}
	
	public Question[] queryQuestion(Integer queryQuId){
		return userMapper.queryQuestion(queryQuId);
	}
	
	public int countQuestion(Integer countQuId){
		return userMapper.countQuestion(countQuId);
	}
	
	public int countChoose(Integer countChId){
		return userMapper.countChoose(countChId);
	}
	
	public boolean addAnswer(Answer answer){
		return userMapper.addAnswer(answer);
	}
}
